package com.chinasofti.controlconsumer.service;

import com.chinasofti.controlcommon.common.ServerResponse;
import com.chinasofti.controlcommon.domain.dto.LoginRequDTO;
import com.chinasofti.controlconsumer.service.imp.UserServiceImp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/*
* fallback:是指定降级的类
* */
@FeignClient(value = "control-token",fallback = UserServiceImp.class)
public interface UserService {

    /*
    * get请求参数是对象数据时，feign接口请求参数需改@RequestParam为@SpringQueryMap，但是不支持feign继承,
    * 或者用@RequestParam将对象字段名都写上，支持feign继承
    * post请求feign不影响，请求参数和spring一致@RequestBody
    * */
    @PostMapping("/login")
    public ServerResponse login(@RequestBody LoginRequDTO loginRequDTO );
}
